#ifndef _SYS_TYPES_H_
#define _SYS_TYPES_H_

#include <stdint.h>


#define FAN_INT_IS_64BIT
#define FAN_FLOAT_IS_64BIT


#ifndef TRUE
#define FALSE   0
#define TRUE    1
#endif


/* Primitive types */
typedef uint8_t fan_bool;
typedef uint16_t fan_char;

#ifdef FAN_INT_IS_64BIT
typedef int64_t fan_int;
#else
typedef int32_t fan_int;
#endif

#ifdef FAN_FLOAT_IS_64BIT
typedef double fan_float;
#else
typedef float fan_float;
#endif


/* Value-type classes */
typedef fan_bool Bool;
typedef fan_char Char;
typedef fan_int Int;
typedef fan_float Float;
typedef struct Val Val;
typedef struct Val Obj;
typedef struct Val Num;
typedef struct Val NullableObj;
typedef struct Val NullableNum;
typedef struct Val NullableBool;
typedef struct Val NullableInt;
typedef struct Val NullableFloat;
typedef struct VTable VTable;


/* Ref-type classes */
typedef struct ArgErr ArgErr;
typedef struct Buf Buf;
typedef struct CancelledErr CancelledErr;
typedef struct CastErr CastErr;
typedef struct Charset Charset;
typedef struct ConstErr ConstErr;
typedef struct Date Date;
typedef struct DateTime DateTime;
typedef struct Decimal Decimal;
typedef struct Depend Depend;
typedef struct Deprecated Deprecated;
typedef struct Duration Duration;
typedef struct Endian Endian;
typedef struct Enum Enum;
typedef struct Env Env;
typedef struct Err Err;
typedef struct Facet Facet;
typedef struct FacetMeta FacetMeta;
typedef struct FanBool FanBool;
typedef struct FanFloat FanFloat;
typedef struct FanInt FanInt;
typedef struct FanNum FanNum;
typedef struct FanObj FanObj;
typedef struct Field Field;
typedef struct FieldNotSetErr FieldNotSetErr;
typedef struct File File;
typedef struct Func Func;
typedef struct IndexErr IndexErr;
typedef struct InStream InStream;
typedef struct InterruptedErr InterruptedErr;
typedef struct IOErr IOErr;
typedef struct Js Js;
typedef struct List List;
typedef struct Locale Locale;
typedef struct Log Log;
typedef struct LogLevel LogLevel;
typedef struct LogRec LogRec;
typedef struct Map Map;
typedef struct MapIterator MapIterator;
typedef struct Method Method;
typedef struct MimeType MimeType;
typedef struct Month Month;
typedef struct NameErr NameErr;
typedef struct NoDoc NoDoc;
typedef struct NotImmutableErr NotImmutableErr;
typedef struct NullErr NullErr;
typedef struct Operator Operator;
typedef struct OutStream OutStream;
typedef struct Param Param;
typedef struct ParseErr ParseErr;
typedef struct Pod Pod;
typedef struct Process Process;
typedef struct Range Range;
typedef struct ReadonlyErr ReadonlyErr;
typedef struct Regex Regex;
typedef struct RegexMatcher RegexMatcher;
typedef struct Serializable Serializable;
typedef struct Service Service;
typedef struct Slot Slot;
typedef struct Str Str;
typedef struct StrBuf StrBuf;
typedef struct StrBufOutStream StrBufOutStream;
typedef struct StrInStream StrInStream;
typedef struct Sys Sys;
typedef struct Test Test;
typedef struct Time Time;
typedef struct TimeoutErr TimeoutErr;
typedef struct TimeZone TimeZone;
typedef struct Transient Transient;
typedef struct Type Type;
typedef struct Unit Unit;
typedef struct UnknownFacetErr UnknownFacetErr;
typedef struct UnknownPodErr UnknownPodErr;
typedef struct UnknownServiceErr UnknownServiceErr;
typedef struct UnknownSlotErr UnknownSlotErr;
typedef struct UnknownTypeErr UnknownTypeErr;
typedef struct UnresolvedErr UnresolvedErr;
typedef struct Unsafe Unsafe;
typedef struct UnsupportedErr UnsupportedErr;
typedef struct Uri Uri;
typedef struct UriScheme UriScheme;
typedef struct Uuid Uuid;
typedef struct Version Version;
typedef struct Void Void;
typedef struct Weekday Weekday;
typedef struct Zip Zip;


#endif
